<?php
if (!defined('BASEPATH'))
	exit('No direct script access allowed');

class Rss extends CI_Controller {
	function __construct() {

		parent::__construct();
		$this -> load -> model('m_pmi');
		$this -> load -> helper('xml');
		$this -> load -> helper('text');
	}

	public function index() {
		//$this -> load -> view('login');
		$data['feed_name'] = 'MyWebsite.com';
		// your website
		$data['encoding'] = 'utf-8';
		// the encoding
		$data['feed_url'] = 'http://www.MyWebsite.com/feed';
		// the url to your feed
		$data['page_description'] = 'What my site is about comes here';
		// some description
		$data['page_language'] = 'en-en';
		// the language
		$data['creator_email'] = 'mail@me.com';
		// your email
		//$data['posts'] = $this -> posts -> getPosts(10);
		header("Content-Type: application/rss+xml");
		$udd=$this->m_pmi->udd();
		foreach ($udd as $key => $u) {
			$data['udd'][$u['id_udd']]=$this->m_pmi->stocterbarubyudd($u['id_udd']);
		}
		//echo '<pre>';
		//print_r($data); exit();
		$this->load->view('rss', $data);
		
		//echo 'asd';
	}

}
